//
//  VWPlayerNoDataBlockLayer.swift
//  VideoPlayer_Example
//
//  Created by JY_NEW on 2021/10/15.
//  Copyright © 2021 CocoaPods. All rights reserved.
//

import ijkPlayerManager
import UIKit
import UICreate

/// Block基类
class VWPlayerBaseBlockLayer: VWPlayerBaseLayer {
    
    override var category: VideoPlayerLayerCategory {
        return .block
    }
    
    override func loadContainerView(_ containerView: UIView) {
        containerView.add(backButton, layout: .top(4), .left)
    }
    
    // MARK: 界面控件
    
    lazy var backButton: UIButton = UIButton(.image(.init(named: "vw_common_back_button")), .size(49), .event(self, #selector(self.onBack)))
    
    @objc func onBack() {
        if self.playerManager?.isFullScreen ?? false {
            self.playerManager?.isFullScreen = false
        }else{
            self.delegate?.onPlayerQuit()
        }
    }
}
